package com.ggs.starbug.rmi.server;

import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;

/**
 * @Author lianghaohui
 * @Date 2021/12/13 11:43
 * @Description https://www.w3cschool.cn/article/30445887.html
 */
public class RMIServer {

    public static void main(String[] args) throws RemoteException, MalformedURLException {
        UserService userService = new UserServiceImpl();
        LocateRegistry.createRegistry(19000);
        Naming.rebind("rmi://localhost:19000/user", userService);
        System.out.println("start server,port is 1900");
    }

}
